package com.fulihui.usercore.api;

import com.fulihui.usercore.condition.UserAddressCondition;
import com.fulihui.usercore.dto.UserAddressDTO;
import com.fulihui.usercore.request.address.UserAddressSaveRequest;
import com.fulihui.usercore.request.address.UserAddressSingleRequest;
import org.near.servicesupport.request.TRequest;
import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TMultiResult;
import org.near.servicesupport.result.TSingleResult;

/**
 * 分表分库 无需修改
 * 用户地址服务
 * Created by Willard.Hu on 2016/5/17.
 */
public interface UserAddressService {

    /**
     * 保存、修改用户地址
     * @param request {@link UserAddressSaveRequest}
     * @return 返回单个用户地址信息 {@link UserAddressDTO}
     */
    TSingleResult<UserAddressDTO> save(UserAddressSaveRequest request);

    /**
     * 删除用户地址，参数传地址主键
     * @param request {@link UserAddressSingleRequest}
     * @return 返回接口调用结果 {@link BaseResult}
     */
    BaseResult delete(UserAddressSingleRequest request);

    /**
     * 按主键查询地址，参数传主键
     * @param request {@link UserAddressSingleRequest}
     * @return 返回单个用户地址信息 {@link UserAddressDTO}
     */
    TSingleResult<UserAddressDTO> queryByPK(UserAddressSingleRequest request);

    /**
     * 查询用户标签，参数传用户唯一标识userId
     * @param request {@link UserAddressCondition}
     * @return 返回多个用户地址信息 {@link UserAddressDTO}
     */
    TMultiResult<UserAddressDTO> queryByUser(TRequest<UserAddressCondition> request);
}
